//
//  SISSAreaModel.m
//  SISSAPP
//
//  Created by 优房网 on 2017/3/28.
//  Copyright © 2017年 优房网. All rights reserved.
//

#import "SISSAreaModel.h"

@implementation SISSAreaModel



- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

-(instancetype)initWithDict:(NSDictionary *)dict{
    
    if (self = [super init]) {
        
        [self setValuesForKeysWithDictionary:dict];
    }
    
    return self;
}


+(instancetype)areaWithDict:(NSDictionary *)dict{
    
    return [[self alloc] initWithDict:dict];
}


#pragma mark - 加载数据
+ (NSArray<SISSAreaModel *>*)loadAreaData {
    
    //获取plist
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"area" withExtension:@"plist"];
    
    //根据plist加载数组
    NSArray *dictArr = [NSArray arrayWithContentsOfURL:url];
    
    //定义一个保存模型类的数组
    NSMutableArray *arrayM = [NSMutableArray array];
    
    //循环遍历字典数组，把每个元素转为模型类对象
    for (NSDictionary *dict in dictArr) {
        
        SISSAreaModel *model = [SISSAreaModel areaWithDict:dict];
        
        [arrayM addObject:model];
    }
    
    return arrayM;
}


@end
